<%@ page language="java" import="com.google.gson.Gson" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="down3.biz.DnFile" %>
<%@ page import="down3.model.DnFileInf" %>
<%@ page import="org.apache.commons.lang.StringUtils" %>
<%@ page import="up7.utils.PathTool" %>
<%
	out.clear();
	/*
		向redis添加一条记录（文件夹）
		更新记录：
			2015-05-13 创建
			2016-07-29 更新
			2017-05-14 完善
	*/
	String uid 		= request.getParameter("uid");
	String cbk 		= request.getParameter("callback");
	String id		= request.getParameter("id");
	String nameLoc	= request.getParameter("nameLoc");
	String pathLoc	= request.getParameter("pathLoc");
	String sizeSvr	= request.getParameter("sizeSvr");
	nameLoc		 	= PathTool.url_decode(nameLoc);
	pathLoc		 	= PathTool.url_decode(pathLoc);
	sizeSvr		 	= PathTool.url_decode(sizeSvr);

	if ( !StringUtils.isBlank(uid)
		|| !StringUtils.isBlank(nameLoc)
		|| !StringUtils.isBlank(pathLoc)
		)
	{
		DnFileInf fd = new DnFileInf();
		fd.nameLoc = nameLoc;
		fd.pathLoc = pathLoc;
		fd.id= id;
		fd.uid = uid;
		fd.fdTask = true;
		fd.sizeSvr = sizeSvr;

		DnFile db = new DnFile();
		db.Add(fd);

		Gson gson = new Gson();
		String json = gson.toJson(fd);
		json = PathTool.url_encode(json);
		json = cbk + "({\"value\":\""+json+"\"})";

		out.write(json);
		return;
	}
%>